<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>媒体查询</title>
    <style>
      /* 视口宽度是375，网页背景色是绿色 */
      @media (width: 375px) {
        html {
          background-color: green;
        }
      }
      /* 视口宽度是414，网页背景色是红色 */
      @media (width: 414px) {
        html {
          background-color: red;
        }
      }
    </style>
  </head>

  <body></body>
</html>
